<!--
 * @description: 
 * @Author: Islands
 * @Date: 2024-06-23 00:09:32
 * @LastEditTime: 2024-06-23 17:29:54
-->
<script lang="ts" setup>
import { props, Emits } from './props';
import Column from './modules/table-column.vue';
const { tableData, rowKey, button, constants, lazy,height } = defineProps(props);
const emit = defineEmits<Emits>();
const load = (row: any, treeNode: unknown, resolve: (date: any) => void) => {
    setTimeout(() => {
        emit('lazyLoad', row, resolve);
    }, 1000);
};
</script>
<template>
    <el-table :data="tableData" :height="height" :row-key="rowKey" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :header-row-style="{ color: '#555' }" :lazy="lazy" :load="load" fit show-overflow-tooltip highlight-current-row class="w-100 custom-table">
        <Column :constants="constants">
            <template #default="scope">
                <slot :scope="scope" />
            </template>
        </Column>
        <el-table-column label="操作" align="center" v-show="button" width="220px" fixed="right">
            <template #default="scope">
                <slot name="button" :scope="scope" />
            </template>
        </el-table-column>
    </el-table>
</template>

